fix(cli): recognize an initiated swap in post-tx instead of reporting expiry#478
Open
jeffrey701 wants to merge 1 commit into
Open
fix(cli): recognize an initiated swap in post-tx instead of reporting expiry#478jeffrey701 wants to merge 1 commit into
jeffrey701 wants to merge 1 commit into
Conversation
… expiry After a swap initiates, vote_initiate clears the reservation row, so get_miner_reserved_until returns 0 and the `reserved_until <= current_block` guard in `alw swap post-tx` reads it as an expired reservation — it deletes pending_swap.json and tells the user to start a new swap, severing the link to the now-live swap. Before assuming expiry, look up the miner's active swap via resolve_recent_swap_id. If one exists, point the user at it (swap id + `alw view swap <id> --watch`), matching the post-confirm success path, rather than reporting expiry. Genuine expiry (no swap) is unchanged. Closes entrius#473
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After a swap initiates, the contract clears the reservation row (
vote_initiate), soget_miner_reserved_untilreturns 0 andalw swap post-tx'sreserved_until <= current_blockcheck reads it as an expired reservation — it deletespending_swap.jsonand tells the user to start over, even though the swap is live.alw view reservationalready hedges this case and points at active-swaps; post-tx didn't.Look up the miner's active swap with
resolve_recent_swap_idbefore assuming expiry. If there's a swap, point the user at it (alw view swap <id> --watch) the same way the post-confirm success path does. Genuine expiry (no swap) is unchanged.Closes #473